<?php
session_start();
include_once ('valid_fns.php');
if (check_valid_user()){
    unset($_SESSION['valid_user']);
    unset($_SESSION['hta_ra']);
    // стираем cookie идентификатора сессии
    if (isset($_COOKIE[session_name()])) {
            setcookie(session_name(), '', time()-42000, '/');
            setcookie('xF', '', time()-42000, '/');
    }        
    session_destroy();
    header('Location: '."index.php");
} else {
    header('Location: '."index.php");
}
display_footer();
?>
